package com.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.TurnoverSumVO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper extends BaseMapper<Orders> {




    Integer countByMap(Map map);

//    @Select("SELECT DATE( order_time ) AS date,sum( amount ) as turnover FROM orders o" +
//            "WHERE o.order_time > #{beginTime} and o.order_time < #{endTime} " +
//            "GROUP BY date")
//    List<TurnoverSumVO> sumByMap(LocalDateTime beginTime, LocalDateTime endTime);

    List<TurnoverSumVO> sumByMap(Map map);

    Double sumTurnoverByMap(Map map);


    Page<Orders> pageQuer(OrdersPageQueryDTO ordersPageQueryDTO);


    Integer countByStatus(Integer status);



}
